home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 59426 / 59426.xpi / chrome / content / ff-overlay.js next >
Text File  |  2010-01-12  |  6KB  |  256 lines

  1. bookerfox.onFirefoxLoad = function(event) {
  2.   document.getElementById("contentAreaContextMenu")
  3.           .addEventListener("popupshowing", function (e){ bookerfox.showFirefoxContextMenu(e); }, false);
  4. };
  5.  
  6. bookerfox.showFirefoxContextMenu = function(event) {
  7.   // show or hide the menuitem based on what the context menu is on
  8.   document.getElementById("context-bookerfox").hidden = gContextMenu.onImage;
  9. };
  10.  
  11. window.addEventListener("load", bookerfox.onFirefoxLoad, false);
  12.  
  13.  
  14. bookerfox.Calculate = function(d) {
  15.   var BookPrice = document.getElementById('BookPrice');
  16.   var p = parseFloat(BookPrice.value);
  17.   var r = Math.round(p*d)/100;
  18.   BookPrice.value = r;
  19. };
  20.  
  21.  
  22.  
  23. bookerfox.OrderLookup = function(mpid) {
  24.   OrderNum = document.getElementById('OrderID');
  25.   var prefix = new String();
  26.   var suffix = new String();
  27.  
  28.   switch(mpid) {
  29.  
  30.   case "AMZUS":
  31.   prefix = "https://sellercentral.amazon.com/gp/orders-v2/details?ie=UTF8&orderID=";
  32.   break;
  33.  
  34.   case "AMZUK":
  35.   prefix = "https://sellercentral.amazon.co.uk/gp/orders-v2/details?ie=UTF8&orderID=";
  36.   break;
  37.  
  38.   case "AMZCA":
  39.   prefix = "https://sellercentral.amazon.ca/gp/orders-v2/details?ie=UTF8&orderID=";
  40.   break;
  41.  
  42.   case "AMZDE":
  43.   prefix = "https://sellercentral.amazon.de/gp/orders-v2/details?ie=UTF8&orderID=";
  44.   break;
  45.  
  46.   case "AMZFR":
  47.   prefix = "https://sellercentral.amazon.fr/gp/orders-v2/details?ie=UTF8&orderID=";
  48.   break;
  49.  
  50.   case "AMZJP":
  51.   prefix = "https://sellercentral.amazon.co.jp/gp/orders-v2/details?ie=UTF8&orderID=";
  52.   break;
  53.  
  54.   case "ABE":
  55.   prefix = "https://www.abebooks.com/servlet/OrderList?abepoid=";
  56.   break;
  57.  
  58.   case "ALI":
  59.   prefix = "http://sellers.alibris.com/ops/ordersearch.cfm?searchval=";
  60.   suffix = "-1";
  61.   break;
  62.  
  63.   case "A1B":
  64.   prefix = "https://www.a1books.com/mkt/invdetail.do?invId=";
  65.   break;
  66.  
  67.   case "BAN":
  68.   prefix = "https://secure.barnesandnoble.com/sellers/ordermgmt/view.asp?orderfilter=searchorderid&orderfiltervalue=";
  69.   suffix = "&stage_ordviewall_searchType||viewsearchorders.x=42&stage_ordviewall_searchType||viewsearchorders.y=5&statusfilter=all&orddatechoice=for&daterange=120";
  70.   break;
  71.  
  72.   case "BIB":
  73.   prefix = "https://www.biblio.com/booksellers/vieworders.php?order_id=";
  74.   break;
  75.  
  76.   case "BUY":
  77.   prefix = "https://sellertools.marketplace.buy.com/OrderE.aspx?o=";
  78.   break;
  79.  
  80.   case "VAL":
  81.   prefix = "";
  82.   break;
  83.  
  84.   case "ECA":
  85.   prefix = "";
  86.   break;
  87.  
  88.   case "TBX":
  89.   prefix = "";
  90.   break;
  91.  
  92.   case "HAF":
  93.   prefix = "https://account.half.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=MyAccountSaleSummary&searchkey=1&search=";
  94.   break;
  95.  
  96.   case "EBA": //eBay orders by username
  97.   prefix = "http://k2b-bulk.ebay.com/ws/eBayISAPI.dll?MyEbaySellingSoldListings&searchparam=4&Search=Search&searchvalue=";
  98.   break;
  99.   
  100.   case "EBA-ON": //eBay orders by order number
  101.   prefix = "http://k2b-bulk.ebay.com/ws/eBayISAPI.dll?MyEbaySellingSoldListings&searchparam=12&Search=Search&searchvalue=";
  102.   break;
  103.   
  104.   case "EBA-EM": //eBay orders by email address
  105.   prefix = "http://k2b-bulk.ebay.com/ws/eBayISAPI.dll?MyEbaySellingSoldListings&searchparam=3&Search=Search&searchvalue=";
  106.   break;
  107.  
  108.   default:
  109.   prefix = "http://www.google.com";
  110.   };
  111.  
  112.  
  113. gBrowser.selectedTab = gBrowser.addTab(prefix + OrderNum.value + suffix);
  114.  
  115. };
  116.  
  117.  
  118.  
  119. bookerfox.GotoLink = function(mphome) {
  120.   var url = new String();
  121.  
  122.  
  123.   switch(mphome) {
  124.  
  125.   case "AMZUS":
  126.   url = "http://www.amazon.com/gp/seller-account/management/your-account.html/";
  127.   break;
  128.  
  129.   case "AMZUK":
  130.   url = "http://www.amazon.co.uk/gp/seller-account/management/your-account.html";
  131.   break;
  132.  
  133.   case "AMZCA":
  134.   url = "https://sellercentral.amazon.ca/gp/homepage.html";
  135.   break;
  136.  
  137.   case "AMZDE":
  138.   url = "http://www.amazon.de/gp/seller-account/management/your-account.html";
  139.   break;
  140.  
  141.   case "AMZFR":
  142.   url = "http://www.amazon.fr/gp/seller-account/management/your-account.html";
  143.   break;
  144.  
  145.   case "AMZJP":
  146.   url = "https://sellercentral.amazon.co.jp/gp/homepage.html";
  147.   break;
  148.  
  149.   case "ABE":
  150.   url = "https://www.abebooks.com/servlet/MembersMainMenu";
  151.   break;
  152.  
  153.   case "ALI":
  154.   url = "http://www.alibris.com/sellers";
  155.   break;
  156.  
  157.   case "A1B":
  158.   url = "https://www.a1books.com/mkt/?WVSESSION_ID=1535173166";
  159.   break;
  160.  
  161.   case "BAN":
  162.   url = "https://secure.barnesandnoble.com/sellers/sellprefs/view.asp?stage=slrmainsignin";
  163.   break;
  164.  
  165.   case "BIB":
  166.   url = "http://www.biblio.com/booksellers/";
  167.   break;
  168.  
  169.   case "BUY":
  170.   url = "https://sellertools.marketplace.buy.com/Login.aspx";
  171.   break;
  172.  
  173.   case "VAL":
  174.   url = "https://www.valorebooks.com/Seller.Overview.do";
  175.   break;
  176.  
  177.   case "ECA":
  178.   url = "http://www.ecampus.com/mp/";
  179.   break;
  180.  
  181.   case "TBX":
  182.   url = "https://www.textbookx.com/account/login.php";
  183.   break;
  184.  
  185.   case "HAF":
  186.   url = "https://account.half.ebay.com/ws/eBayISAPI.dll?MyAccountSummary&guest=1";
  187.   break;
  188.  
  189.   case "EBA":
  190.   url = "https://signin.ebay.com/ws/eBayISAPI.dll?SignIn";
  191.   break;
  192.  
  193.   default:
  194.   url = "http://www.google.com/";
  195.   };
  196.  
  197.   gBrowser.selectedTab = gBrowser.addTab(url);
  198.  
  199. };
  200.  
  201.  
  202.  
  203. bookerfox.Track = function(PS) {
  204.   TrackingNum = document.getElementById('TrackingNum');
  205.   var tprefix = new String();
  206.   var tsuffix = new String();
  207.   
  208.   switch(PS) {
  209.   
  210.   case "USPS":
  211.   tprefix = "http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?strOrigTrackNum=";
  212.   break;
  213.   
  214.   case "UPS":
  215.   tprefix = "http://wwwapps.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=";
  216.   tsuffix = "&track.x=0&track.y=0";
  217.   break;
  218.   
  219. //  case "UPS-MI":
  220. //  tprefix = "";
  221. //  tsuffix = "";
  222. //  break;
  223.   
  224.   default:
  225.   tprefix = "http://www.google.com/";
  226.   };
  227.   
  228.   gBrowser.selectedTab = gBrowser.addTab(tprefix + TrackingNum.value);
  229.   
  230. };
  231.  
  232. bookerfox.LookupListing = function(mkt) {
  233.   ListingID = document.getElementById('ListingID');
  234.   var llprefix = new String();
  235.   
  236.   switch(mkt) {
  237.   
  238.   case "ABE":
  239.   llprefix = "http://www.abebooks.com/servlet/BookDetailsPL?bi=";
  240.   break;
  241.   
  242.   case "ALI":
  243.   llprefix = "http://www.alibris.com/booksearch.detail?invid=";
  244.   break;
  245.   
  246.   case "EBA":
  247.   llprefix = "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=";
  248.   break;
  249.   
  250.   default:
  251.   tprefix = "http://www.google.com/";
  252.   };
  253.   
  254.   gBrowser.selectedTab = gBrowser.addTab(llprefix + ListingID.value);
  255.   
  256. };